﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.master" AutoEventWireup="true"
    ValidateRequest="false" CodeFile="CNSanPham.aspx.cs" Inherits="Admin_SanPham_CNSanPham" %>

<%@ Register TagPrefix="FTB" Namespace="FreeTextBoxControls" Assembly="FreeTextBox" %>
<%@ Register TagPrefix="cc2" Namespace="AjaxControlToolkit" Assembly="AjaxControlToolkit, Version=3.0.30930.28736, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="HomePlaceHolder" runat="Server">
    <script type="text/javascript">
        var GB_ROOT_DIR = "../../GREY_BOX/";
    </script>
    <script language="javascript" type="text/javascript">
        function Upload_HinhAnh() {
            var sFileName = document.getElementById('<%=H_AnhDaiDien.ClientID%>').value;
            var url = "../Admin/SanPham/UploadImage.aspx?sFileName=" + sFileName;
            return GB_showCenter('Tải ảnh đại diện', url, 220, 500);
        }
        function Insert_Image(imgPath, imgName) {
            document.getElementById('<%=imgViewer.ClientID%>').src = imgPath;
            document.getElementById('<%=H_AnhDaiDien.ClientID%>').value = imgName;
        } 
    </script>
    <script src="../../GREY_BOX/AJS.js" type="text/javascript"></script>
    <script src="../../GREY_BOX/AJS_fx.js" type="text/javascript"></script>
    <script src="../../GREY_BOX/gb_scripts.js" type="text/javascript"></script>
    <div class="hrm_header_placeholder">
        Tạo mới bài viết</div>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <div style="float: right; left: 0">
                <table border="0" width="100%" align="left" cellpadding="0" cellspacing="0">
                    <tr>
                        <td width="100%" height="105" style="padding-left: 25px">
                            <asp:Image ID="imgViewer" ToolTip="Ảnh Đại Diện" runat="server" ImageUrl="~/Images/no_image.jpg"
                                CssClass="imgviewer" onclick="JavaScript:Upload_HinhAnh()" Width="130" Height="105" />
                        </td>
                    </tr>
                    <tr>
                        <td style="padding: 5px">
                            &nbsp;&nbsp;(Kích vào hình để tải ảnh đại diện)
                        </td>
                    </tr>
                </table>
            </div>
            <div style="padding: 10px; float: left">
                <asp:HiddenField ID="H_CatalogId" Value="0" runat="server" />
                <asp:HiddenField ID="H_AnhDaiDien" Value="" runat="server" />
                <asp:HiddenField ID="H_TacGia" Value="" runat="server" />
                <asp:HiddenField ID="HiddenField1" Value="0" runat="server" />
                <table border="0" width="100%" cellpadding="0" cellspacing="0">
                    <tr>
                        <td colspan="4" height="4">
                        </td>
                    </tr>
                    <tr>
                        <td width="20">
                        </td>
                        <td width="80" class="hrm_title_blue">
                            Tên Địa điểm
                        </td>
                        <td width="7" class="hrm_title_blue">
                            :
                        </td>
                        <td width="400">
                            <asp:TextBox ID="txtTieuDeTin" CssClass="hrm_textbox" Width="400px" MaxLength="100"
                                runat="server"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" SetFocusOnError="True"
                                ControlToValidate="txtTieuDeTin" Display="Dynamic" ErrorMessage=" (*)"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td width="20">
                        </td>
                        <td width="80" class="hrm_title_blue">
                            Thứ tự Ưu tiên
                        </td>
                        <td width="7" class="hrm_title_blue">
                            :
                        </td>
                        <td width="400">
                            <asp:TextBox ID="tbUutien" CssClass="hrm_textbox" Width="400px" MaxLength="100"
                                runat="server"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator12" runat="server" SetFocusOnError="True"
                                ControlToValidate="txtTieuDeTin" Display="Dynamic" ErrorMessage=" (*)"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="5" height="4">
                        </td>
                    </tr>
                    <tr>
                        <td width="20">
                        </td>
                        <td width="80" class="hrm_title_blue">
                            Nhóm Sản Phẩm
                        </td>
                        <td width="7" class="hrm_title_blue">
                            :
                        </td>
                        <td width="400">
                            <asp:DropDownList ID="cboNhomSanPham" CssClass="hrm_combobox" Width="205px" runat="server">
                            </asp:DropDownList>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" SetFocusOnError="True"
                                InitialValue="0" ControlToValidate="cboNhomSanPham" Display="Dynamic" ErrorMessage=" (*)"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="5" height="4">
                        </td>
                    </tr>
                    <tr>
                        <td width="20">
                        </td>
                        <td width="80" class="hrm_title_blue">
                            Thành phố
                        </td>
                        <td width="7" class="hrm_title_blue">
                            :
                        </td>
                        <td width="400">
                            <asp:DropDownList ID="cboThanhPho" CssClass="hrm_combobox" Width="205px" runat="server"
                                AutoPostBack="True" OnSelectedIndexChanged="SelectedindexchangedcboNhomTin">
                            </asp:DropDownList>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" SetFocusOnError="True"
                                InitialValue="0" ControlToValidate="cboThanhPho" Display="Dynamic" ErrorMessage=" (*)"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="5" height="4">
                        </td>
                    </tr>
                    <tr>
                        <td width="20">
                        </td>
                        <td width="80" class="hrm_title_blue">
                            Quận Huyện
                        </td>
                        <td width="7" class="hrm_title_blue">
                            :
                        </td>
                        <td width="400">
                            <asp:DropDownList ID="cboQuanHuyen" CssClass="hrm_combobox" Width="205px" runat="server"
                                OnSelectedIndexChanged="SelectedindexchangedcboSubTin">
                            </asp:DropDownList>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator11" runat="server" SetFocusOnError="True"
                                InitialValue="0" ControlToValidate="cboQuanHuyen" Display="Dynamic" ErrorMessage=" (*)"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="5" height="4">
                        </td>
                    </tr>
                    <tr>
                        <td colspan="5">
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4" height="4">
                        </td>
                    </tr>
                    <tr>
                        <td width="20">
                        </td>
                        <td width="80" class="hrm_title_blue" valign="top">
                            Tóm tắt
                        </td>
                        <td width="7" class="hrm_title_blue" valign="top">
                            :
                        </td>
                        <td width="400">
                            <asp:TextBox runat="server" ID="txtTomTat" Width="600" Height="100" TextMode="MultiLine"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" SetFocusOnError="True"
                                ControlToValidate="txtTomTat" Display="Dynamic" ErrorMessage=" (*)"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                </table>
                <table border="0" width="100%" cellpadding="0" cellspacing="0">
                    <tr>
                        <td colspan="4" height="4">
                        </td>
                    </tr>
                    <tr>
                        <td width="20">
                        </td>
                        <td width="80" class="hrm_title_blue" valign="top">
                            Nội dung
                        </td>
                        <td width="7" class="hrm_title_blue" valign="top">
                            :
                        </td>
                        <td>
                            <FTB:FreeTextBox ID="txtContent" ImageGalleryPath="~/Upload/SanPham" ToolbarLayout="ParagraphMenu,FontFacesMenu,FontSizesMenu,FontForeColorsMenu,FontForeColorPicker,FontBackColorsMenu,FontBackColorPicker|Bold,Italic,Underline,RemoveFormat|JustifyLeft,JustifyRight,JustifyCenter,JustifyFull;BulletedList,NumberedList,Indent,Outdent;CreateLink,Unlink,InsertImage|InsertImageFromGallery,InsertTable,Preview,WordClean"
                                runat="Server" Width="600px" Height="150px" />
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" SetFocusOnError="True"
                                ControlToValidate="txtContent" Display="Dynamic" ErrorMessage=" (*)"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4" height="4">
                        </td>
                    </tr>
                    <tr>
                        <td width="20">
                        </td>
                        <td width="80" class="hrm_title_blue">
                            Địa Chỉ
                        </td>
                        <td width="7" class="hrm_title_blue">
                            :
                        </td>
                        <td width="400">
                            <asp:TextBox ID="txtDiaChi" CssClass="hrm_textbox" Width="400px" MaxLength="250"
                                runat="server"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" SetFocusOnError="True"
                                ControlToValidate="txtDiaChi" Display="Dynamic" ErrorMessage=" (*)"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4" height="4">
                        </td>
                    </tr>
                    <tr>
                        <td width="20">
                        </td>
                        <td width="80" class="hrm_title_blue">
                            Hóa Đơn
                        </td>
                        <td width="7" class="hrm_title_blue">
                            :
                        </td>
                        <td width="400">
                            <asp:TextBox ID="txtHoaDon" CssClass="hrm_textbox" Width="200px" MaxLength="50" runat="server"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" SetFocusOnError="True"
                                ControlToValidate="txtHoaDon" Display="Dynamic" ErrorMessage=" (*)"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4" height="4">
                        </td>
                    </tr>
                    <tr>
                        <td width="20">
                        </td>
                        <td width="80" class="hrm_title_blue">
                            Phần Trăm(%)
                        </td>
                        <td width="7" class="hrm_title_blue">
                            :
                        </td>
                        <td width="400">
                            <asp:TextBox ID="txtPhanTram" CssClass="hrm_textbox" Width="50px" MaxLength="10"
                                runat="server"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" SetFocusOnError="True"
                                ControlToValidate="txtPhanTram" Display="Dynamic" ErrorMessage=" (*)"></asp:RequiredFieldValidator>
                            <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ErrorMessage="Chỉ chấp nhận kiểu số"
                                Display="Dynamic" ValidationExpression="\d+" ControlToValidate="txtPhanTram"></asp:RegularExpressionValidator>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4" height="10">
                        </td>
                    </tr>
                    <tr>
                        <td width="20">
                        </td>
                        <td colspan="3">
                            <table cellpadding="0" cellspacing="0" width="100%">
                                <tr>
                                    <td width="100" class="hrm_title_blue">
                                        Ngày bắt đầu
                                    </td>
                                    <td width="7" class="hrm_title_blue">
                                        :
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtNgayBatDau" runat="server" CssClass="hrm_textbox" Width="150px"
                                            MaxLength="10" Style="text-align: justify" />
                                        <cc2:CalendarExtender ID="CalendarExtender1" TargetControlID="txtNgayBatDau" Format="dd/MM/yyyy"
                                            runat="server">
                                        </cc2:CalendarExtender>
                                    </td>
                                    <td width="100" class="hrm_title_blue">
                                        Ngày kết thúc
                                    </td>
                                    <td width="7" class="hrm_title_blue">
                                        :
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtNgayKetThuc" runat="server" CssClass="hrm_textbox" Width="150px"
                                            MaxLength="10" Style="text-align: justify" />
                                        <cc2:CalendarExtender ID="CalendarExtender2" TargetControlID="txtNgayKetThuc" Format="dd/MM/yyyy"
                                            runat="server">
                                        </cc2:CalendarExtender>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <font color="red">
                                            <asp:Label ID="lblSoSanh" runat="server"></asp:Label></font>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4" height="4">
                        </td>
                    </tr>
                    <tr>
                        <td width="20">
                        </td>
                        <td width="80" class="hrm_title_blue" valign="top">
                            Điểm nổi bật
                        </td>
                        <td width="7" class="hrm_title_blue" valign="top">
                            :
                        </td>
                        <td>
                            <FTB:FreeTextBox ID="txtNoiBat" ImageGalleryPath="~/Upload/SanPham" ToolbarLayout="ParagraphMenu,FontFacesMenu,FontSizesMenu,FontForeColorsMenu,FontForeColorPicker,FontBackColorsMenu,FontBackColorPicker|Bold,Italic,Underline,RemoveFormat|JustifyLeft,JustifyRight,JustifyCenter,JustifyFull;BulletedList,NumberedList,Indent,Outdent;CreateLink,Unlink,InsertImage|InsertImageFromGallery,InsertTable,Preview,WordClean"
                                runat="Server" Width="600px" Height="100px" />
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator9" runat="server" SetFocusOnError="True"
                                ControlToValidate="txtNoiBat" Display="Dynamic" ErrorMessage=" (*)"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4" height="4">
                        </td>
                    </tr>
                    <tr>
                        <td width="20">
                        </td>
                        <td width="80" class="hrm_title_blue" valign="top">
                            Điều kiện sử dụng
                        </td>
                        <td width="7" class="hrm_title_blue" valign="top">
                            :
                        </td>
                        <td>
                            <FTB:FreeTextBox ID="txtSuDung" ImageGalleryPath="~/Upload/SanPham" ToolbarLayout="ParagraphMenu,FontFacesMenu,FontSizesMenu,FontForeColorsMenu,FontForeColorPicker,FontBackColorsMenu,FontBackColorPicker|Bold,Italic,Underline,RemoveFormat|JustifyLeft,JustifyRight,JustifyCenter,JustifyFull;BulletedList,NumberedList,Indent,Outdent;CreateLink,Unlink,InsertImage|InsertImageFromGallery,InsertTable,Preview,WordClean"
                                runat="Server" Width="600px" Height="100px" />
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator10" runat="server" SetFocusOnError="True"
                                ControlToValidate="txtSuDung" Display="Dynamic" ErrorMessage=" (*)"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4" height="4">
                        </td>
                    </tr>
                    <tr>
                        <td width="20">
                        </td>
                        <td width="80" class="hrm_title_blue">
                            Tin nóng
                        </td>
                        <td width="7" class="hrm_title_blue">
                            :
                        </td>
                        <td>
                            <asp:CheckBox ID="chkTinNong" Checked="true" runat="server" />
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4" height="10">
                        </td>
                    </tr>
                    <tr>
                        <td width="20">
                        </td>
                        <td width="80" class="hrm_title_blue">
                        </td>
                        <td width="7" class="hrm_title_blue">
                        </td>
                        <td>
                            <asp:ImageButton ID="cmdLuu" ImageUrl="~/Images/save.jpg" runat="server" OnClick="cmdLuu_Click" />
                            <asp:ImageButton ID="cmdNhapTiep" ImageUrl="~/Images/nhaptiep.jpg" CausesValidation="false"
                                runat="server" OnClick="cmdNhapTiep_Click" />
                            <asp:ImageButton ID="cmdQuayLai" CausesValidation="false" ImageUrl="~/Images/quaylai.jpg"
                                runat="server" PostBackUrl="~/Admin/SanPham/QLSanPham.aspx" />
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4" height="20">
                        </td>
                    </tr>
                </table>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
